package com.autumn.sms;

import java.util.HashMap;
import java.util.Map;

/**
 * 验证码类型
 * 
 * @author 老码农
 *
 *         2018-01-12 12:26:03
 */
public class VerificationCodeType {
	/**
	 * 注册验证码
	 */
	public static final int TYPE_REGISTER = 1;

	/**
	 * 变更验证码
	 */
	public static final int TYPE_CHANGE = 2;

	/**
	 * 授权验证码
	 */
	public static final int TYPE_AUTHORIZE = 20;

	/**
	 * 绑定验证码
	 */
	public static final int TYPE_BINDING = 30;

	/**
	 * 支付验证码
	 */
	public static final int TYPE_PAY = 40;

	/**
	 * 公共验证码
	 */
	public static final int TYPE_COMMON = 99;

	private final static Map<Integer, String> NAME_MAP = new HashMap<>();

	static {
		NAME_MAP.put(TYPE_REGISTER, "注册验证码");
		NAME_MAP.put(TYPE_CHANGE, "变更验证码");
		NAME_MAP.put(TYPE_AUTHORIZE, "授权验证码");
		NAME_MAP.put(TYPE_BINDING, "绑定验证码");
		NAME_MAP.put(TYPE_PAY, "支付验证码");
		NAME_MAP.put(TYPE_COMMON, "公共验证码");
	}

	/**
	 * 获取名称
	 * 
	 * @param value
	 *            值
	 * @return
	 */
	public static String getName(Integer value) {
		if (value == null) {
			return null;
		}
		return NAME_MAP.get(value);
	}
}
